Suspends the current machine.
If hibernate = true, the system hibernates.
If hibernate = false, the system enters a standby state.
[DllImport ("Powrprof.dll", SetLastError = true)]
static extern bool SetSuspendState (bool hibernate, bool forceCritical, bool disableWakeEvent);
Declare Function SetSuspendState Lib "powrprof.dll" (TODO) As TODO
None.
None.
Please add some!
using System;
using System.Runtime.InteropServices;
namespace Sleeper
{
class Class1
{
[DllImport ("Powrprof.dll", SetLastError = true)]
static extern bool SetSuspendState (bool hibernate, bool forceCritical, bool disableWakeEvent);
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// make the computer go to sleep.
SetSuspendState (true, false, false);
}
}
}
Do you know one? Please contribute it!